import { axios } from '@/utils/request'

/**
 * api接口列表
 */
const api = {
  index: '/book/index',
  detail: '/book/detail',
  add: '/book/add',
  edit: '/book/edit',
  changeStatus: '/book/changeStatus',
  del: '/book/del',
  changeAuth: '/book/changeAuth',
  oldBook: '/bookold/index',
  oldBookEdit: 'bookold/edit',
  addOldBook: '/bookold/add',
  oldBookDetail: '/bookold/detail',
  oldBookDel: '/bookold/del',
  oldBookChangeStatus: '/bookold/changeStatus',
  oldChangeAuth: 'bookold/changeAuth',
  authDetail: '/book/authDetail',
  changeBookAuth: '/book/changeBookAuth',
  oldBookChangeBookAuth: '/bookold/changeBookAuth',
  changeOldBookAuthList: 'bookold/changeBookAuthList',
  changeBookAuthList: 'book/changeBookAuthList',
  changeOldBookAuthByName: 'bookold/changeBookAuthByName',
  changeBookAuthByName: 'book/changeBookAuthByName'
}

/**
 * 列表记录
 */
export function list(params) {
  return axios({
    url: api.index,
    method: 'get',
    params
  })
}

/**
 * 详情(详细信息)
 */
export function detail(params) {
  return axios({
    url: api.detail,
    method: 'get',
    params
  })
}

export function add(data) {
  return axios({
    url: api.add,
    method: 'post',
    data
  })
}

export function edit(data) {
  return axios({
    url: api.edit,
    method: 'post',
    data
  })
}

export function del(params) {
  return axios({
    url: api.del,
    method: 'get',
    params
  })
}

export function changeStatus(params) {
  return axios({
    url: api.changeStatus,
    method: 'get',
    params
  })
}

export function oldBookList(params) {
  return axios({
    url: api.oldBook,
    method: 'get',
    params
  })
}

export function addOldBook(data) {
  return axios({
    url: api.addOldBook,
    method: 'post',
    data
  })
}

export function editOldBook(data) {
  return axios({
    url: api.oldBookEdit,
    method: 'post',
    data
  })
}

export function oldBookDetail(params) {
  return axios({
    url: api.oldBookDetail,
    method: 'get',
    params
  })
}

export function oldBookDelete(params) {
  return axios({
    url: api.oldBookDel,
    method: 'get',
    params
  })
}

export function oldBookChangeStatus(params) {
  return axios({
    url: api.oldBookChangeStatus,
    method: 'get',
    params
  })
}

export function changeAuth(params) {
  return axios({
    url: api.changeAuth,
    method: 'get',
    params
  })
}

export function oldChangeAuth(params) {
  return axios({
    url: api.oldChangeAuth,
    method: 'get',
    params
  })
}

export function authDetail(params) {
  return axios({
    url: api.authDetail,
    method: 'get',
    params
  })
}

export function changeBookAuth(params) {
  return axios({
    url: api.changeBookAuth,
    method: 'get',
    params
  })
}

export function oldBookChangeBookAuth(params) {
  return axios({
    url: api.oldBookChangeBookAuth,
    method: 'get',
    params
  })
}

export function changeBookAuthList(data) {
  return axios({
    url: api.changeBookAuthList,
    method: 'post',
    data
  })
}

export function oldChangeBookAuthList(data) {
  return axios({
    url: api.changeOldBookAuthList,
    method: 'post',
    data
  })
}

export function changeOldBookAuthByName(data) {
  return axios({
    url: api.changeOldBookAuthByName,
    method: 'post',
    data
  })
}

export function changeBookAuthByName(data) {
  return axios({
    url: api.changeBookAuthByName,
    method: 'post',
    data
  })
}